home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 19 / Mac Magazin and MacEasy Magazine CD - Issue 19.iso / Grafik & Text & Film / Quark XTensions / Freeware Xtensions / XPress Scripts 1.0 / Linotronic 330 Setup / Linotronic 330 Setup next >
Text File  |  1994-08-10  |  7KB  |  164 lines

  1. tell application "QuarkXPress 3.3"
  2.     activate
  3.     if document 1 exists then
  4.         
  5.         set maxFilmWidth to 305.481
  6.         set paperWidth to 305
  7.         set printerType to "Linotronic"
  8.         
  9.         copy page height of document 1 as integer to pageHeight
  10.         copy page width of document 1 as integer to pageWidth
  11.         copy registration marks offset to singleDocOffset
  12.         copy (singleDocOffset / 2.83) * 4 to docOffsets
  13.         copy pageHeight + docOffsets to pageAndOffsetHeight
  14.         copy pageWidth + docOffsets to pageAndOffsetWidth
  15.         
  16.         tell document 1
  17.             copy number of pages of current spread to PagesPerSpread
  18.             set docName to name
  19.             
  20.             copy (display dialog "Linotronic 330 Print Setup for:" & return & "'" & docName & "'" buttons {"Cancel", "Setup..."} default button 2 with icon 2000) to x
  21.             do updates
  22.             if button returned of x is "Setup..." then
  23.                 if pageAndOffsetHeight > maxFilmWidth and pageAndOffsetWidth > maxFilmWidth then
  24.                     beep
  25.                     display dialog "Page size of this document is too" & return & ¬
  26.                         "large for Linotronic 330. Check page" & return & "size and/or registration mark offsets." buttons "OK" default button 1 with icon 0
  27.                     do updates
  28.                 else
  29.                     tell print setup
  30.                         
  31.                         set adjust horizontal tile to false
  32.                         set auto tile overlap to 0
  33.                         set back to front to false
  34.                         set calibrated output to false
  35.                         set collate to false
  36.                         set data format to binary data
  37.                         set flip vertical to false
  38.                         set font substitution to false
  39.                         set graphics smoothing to false
  40.                         set include blank pages to false
  41.                         set larger print area to false
  42.                         set page gap to 0
  43.                         set page sequence to all pages
  44.                         set paper offset to 0
  45.                         set print colors as grays to false
  46.                         set print quality to normal
  47.                         set print thumbnails to false
  48.                         set reduce or enlarge to 100
  49.                         set registration marks to centered
  50.                         set separation to true
  51.                         set text smoothing to false
  52.                         set tiling to off
  53.                         set unlimited downloadable fonts to false
  54.                         set use PDF screen values to false
  55.                     end tell
  56.                     
  57.                     copy text returned of (display dialog "Halftone screen:" default answer ¬
  58.                         "150" buttons {"  Okay  "} default button 1 with icon 2001) to halftoneScreen
  59.                     do updates
  60.                     copy halftoneScreen as real to halftoneScreen
  61.                     try
  62.                         if halftoneScreen ≥ 65 and halftoneScreen < 75 then
  63.                             copy "1270" to printRes
  64.                         else if halftoneScreen ≥ 75 and halftoneScreen < 85 then
  65.                             copy "1693" to printRes
  66.                         else if halftoneScreen ≥ 85 and halftoneScreen < 133 then
  67.                             copy "2032" to printRes
  68.                         else if halftoneScreen ≥ 133 and halftoneScreen ≤ 175 then
  69.                             copy "2540" to printRes
  70.                         else if halftoneScreen > 175 and halftoneScreen ≤ 200 then
  71.                             copy "3386" to printRes
  72.                         else
  73.                             error number -130
  74.                         end if
  75.                         
  76.                         copy (display dialog "Film output:" & return & " " buttons {"Negative", "Positive"} default button 2 with icon 2001) to filmOutput
  77.                         do updates
  78.                         if button returned of filmOutput is "Negative" then
  79.                             copy true to filmState
  80.                         else if button returned of filmOutput is "Positive" then
  81.                             copy false to filmState
  82.                         end if
  83.                         
  84.                         copy (display dialog "Film emulsion:" & return & " " buttons {"Up", " Down "} default button 2 with icon 2001) to filmEmulsion
  85.                         do updates
  86.                         if button returned of filmEmulsion is "Up" then
  87.                             copy false to filmEmuls
  88.                         else if button returned of filmEmulsion is " Down " then
  89.                             copy true to filmEmuls
  90.                         end if
  91.                         
  92.                         if pageAndOffsetHeight < maxFilmWidth and pageAndOffsetWidth < maxFilmWidth and pageAndOffsetHeight < pageAndOffsetWidth then
  93.                             copy portrait to filmOrientation
  94.                         else if pageAndOffsetHeight < maxFilmWidth and pageAndOffsetWidth < maxFilmWidth and pageAndOffsetHeight > pageAndOffsetWidth then
  95.                             copy landscape to filmOrientation
  96.                         else if pageAndOffsetHeight < maxFilmWidth and pageAndOffsetWidth > maxFilmWidth then
  97.                             copy landscape to filmOrientation
  98.                         else if pageAndOffsetHeight < pageAndOffsetWidth then
  99.                             copy portrait to filmOrientation
  100.                         else if pageAndOffsetHeight > maxFilmWidth and pageAndOffsetWidth < maxFilmWidth then
  101.                             copy portrait to filmOrientation
  102.                         end if
  103.                         
  104.                         copy (display dialog "Spreads:" & return & " " buttons {"On", "   Off   "} default button 2 with icon 2001) to docSpreadsDLOG
  105.                         do updates
  106.                         if button returned of docSpreadsDLOG is "On" then
  107.                             copy true to docSpreads
  108.                             copy (pageAndOffsetWidth * 2) - (singleDocOffset * 2) to doublePageAndOffsetWidth
  109.                             
  110.                             if doublePageAndOffsetWidth > maxFilmWidth and pageAndOffsetHeight < maxFilmWidth and filmOrientation = portrait then
  111.                                 copy landscape to filmOrientation
  112.                             else if doublePageAndOffsetWidth > 305.481 and filmOrientation = portrait then
  113.                                 beep
  114.                                 display dialog "Page size of this document is too" & return & ¬
  115.                                     "large for Linotronic 330. Check page" & return & "size and/or registration mark offsets." buttons "OK" default button 1 with icon 0
  116.                                 do updates
  117.                                 error number -128
  118.                             else if pageAndOffsetHeight < maxFilmWidth and doublePageAndOffsetWidth < maxFilmWidth and pageAndOffsetHeight < doublePageAndOffsetWidth then
  119.                                 copy portrait to filmOrientation
  120.                             else if pageAndOffsetHeight < maxFilmWidth and doublePageAndOffsetWidth < maxFilmWidth and pageAndOffsetHeight > doublePageAndOffsetWidth then
  121.                                 copy landscape to filmOrientation
  122.                             else if pageAndOffsetHeight < maxFilmWidth and doublePageAndOffsetWidth > maxFilmWidth then
  123.                                 copy landscape to filmOrientation
  124.                             else if pageAndOffsetHeight < doublePageAndOffsetWidth then
  125.                                 copy portrait to filmOrientation
  126.                             else if pageAndOffsetHeight > maxFilmWidth and doublePageAndOffsetWidth < maxFilmWidth then
  127.                                 copy portrait to filmOrientation
  128.                             end if
  129.                             
  130.                         else if button returned of docSpreadsDLOG is "   Off   " then
  131.                             copy false to docSpreads
  132.                         end if
  133.                         
  134.                         tell print setup
  135.                             
  136.                             set printer type to printerType --**
  137.                             set paper width to paperWidth --**
  138.                             set flip horizontal to filmEmuls --**
  139.                             set orientation to filmOrientation --**
  140.                             set halftone screen to halftoneScreen --**
  141.                             set invert image to filmState --**
  142.                             set print spreads to docSpreads --**
  143.                             set resolution to printRes --**
  144.                             
  145.                             set font substitution to false --these 3 repeated to be sure that they will be off 
  146.                             set graphics smoothing to false --(they occasionally do not turn off)
  147.                             set text smoothing to false
  148.                             
  149.                         end tell
  150.                     on error number -130
  151.                         beep
  152.                         display dialog "Invalid entry for halftone screen." & return & "‘" & halftoneScreen & "’ cannot be used." buttons "Cancel" default button 1 with icon 1
  153.                         do updates
  154.                     end try
  155.                 end if
  156.             end if
  157.         end tell
  158.     else
  159.         beep
  160.         display dialog "This script requires an" & return & "open QuarkXPress document." buttons "  Okay  " default button 1 with icon 1
  161.         do updates
  162.     end if
  163. end tell
  164.